home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 21 / CU Amiga Magazine's Super CD-ROM 21 (1998)(EMAP Images)(GB)[!][issue 1998-04].iso / CUCD / Games / ADoom / ADoom_src / doomdef.h < prev    next >
C/C++ Source or Header  |  1998-02-04  |  7KB  |  345 lines

  1. // Emacs style mode select   -*- C++ -*- 
  2. //-----------------------------------------------------------------------------
  3. //
  4. // $Id:$
  5. //
  6. // Copyright (C) 1993-1996 by id Software, Inc.
  7. //
  8. // This source is available for distribution and/or modification
  9. // only under the terms of the DOOM Source Code License as
  10. // published by id Software. All rights reserved.
  11. //
  12. // The source is distributed in the hope that it will be useful,
  13. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. // FITNESS FOR A PARTICULAR PURPOSE. See the DOOM Source Code License
  15. // for more details.
  16. //
  17. // DESCRIPTION:
  18. //  Internally used data structures for virtually everything,
  19. //   key definitions, lots of other stuff.
  20. //
  21. //-----------------------------------------------------------------------------
  22.  
  23. #ifndef __DOOMDEF__
  24. #define __DOOMDEF__
  25.  
  26. #include <stdio.h>
  27. #include <string.h>
  28.  
  29. #ifdef __SASC
  30. #define FAR __far
  31. #else
  32. #define FAR
  33. #endif
  34.  
  35. //
  36. // Global parameters/defines.
  37. //
  38. // DOOM version
  39. //enum { VERSION =  110 };
  40. extern int VERSION;
  41.  
  42. // Game mode handling - identify IWAD version
  43. //  to handle IWAD dependend animations etc.
  44. typedef enum
  45. {
  46.   shareware,    // DOOM 1 shareware, E1, M9
  47.   registered,    // DOOM 1 registered, E3, M27
  48.   commercial,    // DOOM 2 retail, E1 M34
  49.   // DOOM 2 german edition not handled
  50.   retail,    // DOOM 1 retail, E4, M36
  51.   indetermined    // Well, no IWAD found.
  52.   
  53. } GameMode_t;
  54.  
  55.  
  56. // Mission packs - might be useful for TC stuff?
  57. typedef enum
  58. {
  59.   doom,        // DOOM 1
  60.   doom2,    // DOOM 2
  61.   pack_tnt,    // TNT mission pack
  62.   pack_plut,    // Plutonia pack
  63.   none
  64.  
  65. } GameMission_t;
  66.  
  67.  
  68. // Identify language to use, software localization.
  69. typedef enum
  70. {
  71.   english,
  72.   french,
  73.   german,
  74.   unknown
  75.  
  76. } Language_t;
  77.  
  78.  
  79. // If rangecheck is undefined,
  80. // most parameter validation debugging code will not be compiled
  81. //#define RANGECHECK
  82.  
  83. // Do or do not use external soundserver.
  84. // The sndserver binary to be run separately
  85. //  has been introduced by Dave Taylor.
  86. // The integrated sound support is experimental,
  87. //  and unfinished. Default is synchronous.
  88. // Experimental asynchronous timer based is
  89. //  handled by SNDINTR. 
  90. //#define SNDSERV  1
  91. //#define SNDINTR  1
  92.  
  93.  
  94. // This one switches between MIT SHM (no proper mouse)
  95. // and XFree86 DGA (mickey sampling). The original
  96. // linuxdoom used SHM, which is default.
  97. //#define X11_DGA        1
  98.  
  99.  
  100. //
  101. // For resize of screen, at start of game.
  102. // It will not work dynamically, see visplanes.
  103. //
  104. #define    BASE_WIDTH        320
  105.  
  106. // It is educational but futile to change this
  107. //  scaling e.g. to 2. Drawing of status bar,
  108. //  menues etc. is tied to the scale implied
  109. //  by the graphics.
  110. #define    SCREEN_MUL        1
  111. #define    INV_ASPECT_RATIO    0.625 // 0.75, ideally
  112.  
  113. // Defines suck. C sucks.
  114. // C++ might sucks for OOP, but it sure is a better C.
  115. // So there.
  116. #define SCREENWIDTH  320
  117. //SCREEN_MUL*BASE_WIDTH //320
  118. #define SCREENHEIGHT 200
  119. //(int)(SCREEN_MUL*BASE_WIDTH*INV_ASPECT_RATIO) //200
  120.  
  121.  
  122.  
  123.  
  124. // The maximum number of players, multiplayer/networking.
  125. #define MAXPLAYERS        4
  126.  
  127. // State updates, number of tics / second.
  128. #define TICRATE        35
  129.  
  130. // The current state of the game: whether we are
  131. // playing, gazing at the intermission screen,
  132. // the game final animation, or a demo. 
  133. typedef enum
  134. {
  135.     GS_LEVEL,
  136.     GS_INTERMISSION,
  137.     GS_FINALE,
  138.     GS_DEMOSCREEN
  139. } gamestate_t;
  140.  
  141. //
  142. // Difficulty/skill settings/filters.
  143. //
  144.  
  145. // Skill flags.
  146. #define    MTF_EASY        1
  147. #define    MTF_NORMAL        2
  148. #define    MTF_HARD        4
  149.  
  150. // Deaf monsters/do not react to sound.
  151. #define    MTF_AMBUSH        8
  152.  
  153. typedef enum
  154. {
  155.     sk_baby,
  156.     sk_easy,
  157.     sk_medium,
  158.     sk_hard,
  159.     sk_nightmare
  160. } skill_t;
  161.  
  162.  
  163.  
  164.  
  165. //
  166. // Key cards.
  167. //
  168. typedef enum
  169. {
  170.     it_bluecard,
  171.     it_yellowcard,
  172.     it_redcard,
  173.     it_blueskull,
  174.     it_yellowskull,
  175.     it_redskull,
  176.     
  177.     NUMCARDS
  178.     
  179. } card_t;
  180.  
  181.  
  182.  
  183. // The defined weapons,
  184. //  including a marker indicating
  185. //  user has not changed weapon.
  186. typedef enum
  187. {
  188.     wp_fist,
  189.     wp_pistol,
  190.     wp_shotgun,
  191.     wp_chaingun,
  192.     wp_missile,
  193.     wp_plasma,
  194.     wp_bfg,
  195.     wp_chainsaw,
  196.     wp_supershotgun,
  197.  
  198.     NUMWEAPONS,
  199.     
  200.     // No pending weapon change.
  201.     wp_nochange
  202.  
  203. } weapontype_t;
  204.  
  205.  
  206. // Ammunition types defined.
  207. typedef enum
  208. {
  209.     am_clip,    // Pistol / chaingun ammo.
  210.     am_shell,    // Shotgun / double barreled shotgun.
  211.     am_cell,    // Plasma rifle, BFG.
  212.     am_misl,    // Missile launcher.
  213.     NUMAMMO,
  214.     am_noammo    // Unlimited for chainsaw / fist.    
  215.  
  216. } ammotype_t;
  217.  
  218.  
  219. // Power up artifacts.
  220. typedef enum
  221. {
  222.     pw_invulnerability,
  223.     pw_strength,
  224.     pw_invisibility,
  225.     pw_ironfeet,
  226.     pw_allmap,
  227.     pw_infrared,
  228.     NUMPOWERS
  229.     
  230. } powertype_t;
  231.  
  232.  
  233.  
  234. //
  235. // Power up durations,
  236. //  how many seconds till expiration,
  237. //  assuming TICRATE is 35 ticks/second.
  238. //
  239. typedef enum
  240. {
  241.     INVULNTICS    = (30*TICRATE),
  242.     INVISTICS    = (60*TICRATE),
  243.     INFRATICS    = (120*TICRATE),
  244.     IRONTICS    = (60*TICRATE)
  245.     
  246. } powerduration_t;
  247.  
  248.  
  249.  
  250.  
  251. //
  252. // DOOM keyboard definition.
  253. // This is the stuff configured by Setup.Exe.
  254. // Most key data are simple ascii (uppercased).
  255. //
  256. #define KEY_RIGHTARROW    0xae
  257. #define KEY_LEFTARROW    0xac
  258. #define KEY_UPARROW    0xad
  259. #define KEY_DOWNARROW    0xaf
  260. #define KEY_ESCAPE    27
  261. #define KEY_ENTER    13
  262. #define KEY_TAB        9
  263. #define KEY_F1        (0x80+0x3b)
  264. #define KEY_F2        (0x80+0x3c)
  265. #define KEY_F3        (0x80+0x3d)
  266. #define KEY_F4        (0x80+0x3e)
  267. #define KEY_F5        (0x80+0x3f)
  268. #define KEY_F6        (0x80+0x40)
  269. #define KEY_F7        (0x80+0x41)
  270. #define KEY_F8        (0x80+0x42)
  271. #define KEY_F9        (0x80+0x43)
  272. #define KEY_F10        (0x80+0x44)
  273. #define KEY_F11        (0x80+0x57)
  274. #define KEY_F12        (0x80+0x58)
  275.  
  276. #define KEY_BACKSPACE    127
  277. #define KEY_PAUSE    0xff
  278.  
  279. #define KEY_EQUALS    0x3d
  280. #define KEY_MINUS    0x2d
  281.  
  282. #define KEY_RSHIFT    (0x80+0x36)
  283. #define KEY_RCTRL    (0x80+0x1d)
  284. #define KEY_RALT    (0x80+0x38)
  285.  
  286. #define KEY_LALT    KEY_RALT
  287.  
  288.  
  289.  
  290. // DOOM basic types (boolean),
  291. //  and max/min values.
  292. //#include "doomtype.h"
  293.  
  294. // Fixed point.
  295. //#include "m_fixed.h"
  296.  
  297. // Endianess handling.
  298. //#include "m_swap.h"
  299.  
  300.  
  301. // Binary Angles, sine/cosine/atan lookups.
  302. //#include "tables.h"
  303.  
  304. // Event type.
  305. //#include "d_event.h"
  306.  
  307. // Game function, skills.
  308. //#include "g_game.h"
  309.  
  310. // All external data is defined here.
  311. //#include "doomdata.h"
  312.  
  313. // All important printed strings.
  314. // Language selection (message strings).
  315. //#include "dstrings.h"
  316.  
  317. // Player is a special actor.
  318. //struct player_s;
  319.  
  320.  
  321. //#include "d_items.h"
  322. //#include "d_player.h"
  323. //#include "p_mobj.h"
  324. //#include "d_net.h"
  325.  
  326. // PLAY
  327. //#include "p_tick.h"
  328.  
  329.  
  330.  
  331.  
  332. // Header, generated by sound utility.
  333. // The utility was written by Dave Taylor.
  334. //#include "sounds.h"
  335.  
  336.  
  337.  
  338.  
  339. #endif          // __DOOMDEF__
  340. //-----------------------------------------------------------------------------
  341. //
  342. // $Log:$
  343. //
  344. //-----------------------------------------------------------------------------
  345.